package org.xxpay.pay.channel.yeepay;

import com.alibaba.fastjson.JSONObject;
import org.springframework.util.Assert;

/**
 * 易宝支付
 */
public class YeepayConfig {

    // 总公司编号
    private String groupId;
    // 商户编码
    private String merId;
    // 商户秘钥
    private String hmacKey;
    // 私钥证书
    private String pfxFilePath;
    // 证书秘钥
    private String pfxPassword;
    // 发起代付/查询代付订单请求地址
    private String transReqUrl;
    // 查询余额请求地址
    private String queryBalanceUrl;
    // 渠道名称:易宝支付
    public final static String CHANNEL_NAME_YEEPAY = "yeepay";

    public YeepayConfig(){}
    public YeepayConfig(String payParam) {
        Assert.notNull(payParam, "init yeepay config error");
        YeepayConfig config = JSONObject.parseObject(payParam, YeepayConfig.class);
        this.groupId = config.getGroupId();
        this.merId = config.getMerId();
        this.hmacKey = config.getHmacKey();
        this.pfxFilePath = config.getPfxFilePath();
        this.pfxPassword = config.getPfxPassword();
        this.transReqUrl = config.getTransReqUrl();
        this.queryBalanceUrl = config.getQueryBalanceUrl();
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public String getMerId() {
        return merId;
    }

    public void setMerId(String merId) {
        this.merId = merId;
    }

    public String getHmacKey() {
        return hmacKey;
    }

    public void setHmacKey(String hmacKey) {
        this.hmacKey = hmacKey;
    }

    public String getPfxFilePath() {
        return pfxFilePath;
    }

    public void setPfxFilePath(String pfxFilePath) {
        this.pfxFilePath = pfxFilePath;
    }

    public String getPfxPassword() {
        return pfxPassword;
    }

    public void setPfxPassword(String pfxPassword) {
        this.pfxPassword = pfxPassword;
    }

    public String getTransReqUrl() {
        return transReqUrl;
    }

    public void setTransReqUrl(String transReqUrl) {
        this.transReqUrl = transReqUrl;
    }

    public String getQueryBalanceUrl() {
        return queryBalanceUrl;
    }

    public void setQueryBalanceUrl(String queryBalanceUrl) {
        this.queryBalanceUrl = queryBalanceUrl;
    }
}
